package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import javax.swing.JButton;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VistaTablaPosiciones extends javax.swing.JFrame {
	private JPanel panPosiciones;
	private JButton btnSalir;
	private JTable tblPosiciones;
	private JLabel lblTitulo;
	private JScrollPane scpPosiciones;
	
	public VistaTablaPosiciones() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				panPosiciones = new JPanel();
				getContentPane().add(panPosiciones, null);
				panPosiciones.setLayout(null);
				panPosiciones.setPreferredSize(new java.awt.Dimension(517, 299));
				setTitle("Tabla de Posiciones");

				{
					lblTitulo = new JLabel();
					panPosiciones.add(lblTitulo);
					lblTitulo.setText("Tabla de Posiciones");
					lblTitulo.setBounds(187, 12, 147, 16);
				}
				{
					
					scpPosiciones = new JScrollPane();
					scpPosiciones.setBounds(18, 40, 487, 208);
					
					tblPosiciones = new JTable();
					tblPosiciones.setBounds(18, 40, 487, 208);
					
					scpPosiciones.setViewportView(tblPosiciones);
					panPosiciones.add(scpPosiciones);
				}
				{
					btnSalir = new JButton();
					panPosiciones.add(btnSalir);
					btnSalir.setText("Salir");
					btnSalir.setBounds(438, 265, 68, 22);
				}
			}
			pack();
			this.setSize(523, 332);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	public void agregarListener(ActionListener accion){
		btnSalir.addActionListener(accion);
	}

	public void setModeloDeTabla(TableModel modelo){
		tblPosiciones.setModel(modelo);
	}
}
